package com.libo.client.send.impl;

import com.libo.bean.Environment;
import com.libo.client.send.Send;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.List;

public class SendImpl implements Send {
    @Override
    public void send(List<Environment> environments) {

    }

    public void send(List<Environment> environments, Socket socket) {
        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(socket.getOutputStream());
            oos.writeObject(environments);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            if (oos != null){
                try {
                    oos.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

    }
}
